import bcrypt from 'bcrypt';

/**
 * 密码加密
*/
export const pwdEncryption = (pwd: string) => {
  const salt = bcrypt.genSaltSync(10);
  return bcrypt.hashSync(pwd, salt);
}

/**
 * 密码解密
 */
export const pwdDecrypt = (pwd: string, hash: string) => {
  return bcrypt.compareSync(pwd, hash);
}